package com.feihong.txgw.inter.contract.recharge;

import com.feihong.txgw.json.recharge.PhoneLocationInfo;
import com.feihong.txgw.json.recharge.SubmitOrderInfo;
import com.feihong.txgw.ui.mvp.model.IBaseModel;
import com.feihong.txgw.ui.mvp.precenter.AbBasePrecenter;
import com.feihong.txgw.ui.mvp.view.IBaseFragment;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName RechargeContract
 * @package com.feihong.txgw.inter.contract.recharge
 * @data 2018/5/7 11:05
 * @Describe
 * @Change
 */
public interface RechargeContract {

    interface IRechargeMainView extends IBaseFragment{

        void loadOperatorsResult(PhoneLocationInfo info);

        void submitRechargeOrderResult(SubmitOrderInfo submitOrderInfo);
    }

    interface IRechargeMainModel extends IBaseModel{

        /** 获取充值号码的归属地 以及可以充值的数据
         * @param rechargeType  充值类型
         * @param rechargeTel  充值号码
         */
        Observable<PhoneLocationInfo> getOperators(String rechargeType,String rechargeTel);

        /**
         *
         * @param rechargeType 充值类型
         * @param rechargeTel  充值号码
         * @param terminalType  充值终端类型
         * @param goodsID  商品id
         */
        Observable<String> submitRechargeOrder(String rechargeType, String rechargeTel, String terminalType, String goodsID);
    }

    abstract class AbRechargeMainPrecenter extends AbBasePrecenter<IRechargeMainModel,IRechargeMainView>{

        public abstract void loadOperator(String rechargeType,String rechargeTel);

        public abstract void submitRechargeOrder(String rechargeType,String rechargeTel,String terminalType,String goodsID);

    }

}
